package com.server.admin.Impl;

import com.dao.db1.admin.AdminUserDao;
import com.pojo.User;
import com.server.admin.AdminUserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminUserServerImpl implements AdminUserServer {
    private AdminUserDao adminUserDao;
    @Autowired
    public AdminUserServerImpl(AdminUserDao adminUserDao) {
        this.adminUserDao = adminUserDao;
    }


    @Override
    public List<User> selectAdminUser(String username, String name, int limit, int page) {
        return adminUserDao.selectAdminUser(username,name,limit,page);
    }

    @Override
    public int insertAdminUser(String username, String password, int status, String name, String bmmc, String sszz, int departmentId, int userId, String register_time) {
        return adminUserDao.insertAdminUser(username,password,status,name,bmmc,sszz,departmentId,userId,register_time);
    }

    @Override
    public int getAutoId() {
        return adminUserDao.getAutoId();
    }

    @Override
    public int updateAdminUser(String username, String password, int status, String name, String bmmc, String sszz, int departmentId, int userId, String update_time) {
        return adminUserDao.updateAdminUser(username,password,status,name,bmmc,sszz,departmentId,userId,update_time);
    }

    @Override
    public int repeatUsername(String username) {
        return adminUserDao.repeatUsername(username);
    }

    @Override
    public List<User> selectUserId(int userId) {
        return adminUserDao.selectUserId(userId);
    }

    @Override
    public int deleteAdminUser(int userId) {
        return adminUserDao.deleteAdminUser(userId);
    }

    @Override
    public int deleteAdminUserRole(int userId) {
        return adminUserDao.deleteAdminUserRole(userId);
    }

    @Override
    public int InsertAdminUserRole(int userId, int roleId) {
        return adminUserDao.InsertAdminUserRole(userId,roleId);
    }


}
